﻿using StudentsBaseClass.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace StudentsBaseClass.Controllers
{
    public class HomeController : Controller
    {
        List<Boy> boys = new List<Boy>()
        {
            new Boy(1, "Johnny Blaze", "FootBall"),
            new Boy(2, "Johan Santana", "BasketBall"),
            new Boy(6, "Magic Johnson", "BasketBall"),
            new Boy(7, "Allen Iverson", "BasketBall"),
            new Boy(8, "Johnny Storm", "Football")
        };
        List<Girl> girls = new List<Girl>(){
            new Girl(3, "Susan Storm", "Movies"),
            new Girl(4, "Amy Smith", "Photo"),
            new Girl(5, "Sara Johnson", "Programming"),
        };

        List<Student> students = new List<Student>(){
            new Boy(9, "Al Bundy", "ShoeSales"),
            new Boy(10, "Billy Barnes", "Lala"),
            new Girl(11, "Sally Field", "Cooking"),
            new Girl(12, "Amanda Bynes", "Acting")
        };
        public ActionResult ListView()  // new view to place both lists
        {
            Bucket bucket = new Bucket();  // defining bucket 
            bucket.boys = boys;
            bucket.girls = girls;
            return View(bucket);
        }
        public ActionResult Index()
        {

            return View();
        }
        public ActionResult Index(int id, string name )
        {
            Student student = new Student();
            student.Name = name;
            student.ID = id;
            student.Add(student);
            return RedirectToAction("Index");
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View(boys);
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View(girls);
        }
    }
}